Skip to content

Add in support for segmented binary stream snapshots.#4284

Merged
derekcollison merged 1 commit intodevfrom
binary-stream-snapshot
Jul 5, 2023
Merged

Add in support for segmented binary stream snapshots.#4284
derekcollison merged 1 commit intodevfrom
binary-stream-snapshot

Conversation

@derekcollison
Copy link
Copy Markdown
Member

Streams with many interior deletes was causing issues due to the fact that the interior deletes were represented as a sorted []uint64. This could cause snapshots for streams R>1 and with lots of interior deletes to take up more memory and cpu then we want.

This new approach introduces 3 sub types of delete blocks, an avl bitmask tree, a run length encoding, and the legacy format above. We also take into account large interior deletes such that on receiving a snapshot we can skip things we already know about.

Signed-off-by: Derek Collison derek@nats.io

@derekcollison derekcollison requested a review from a team as a code owner July 1, 2023 06:13
Copy link
Copy Markdown
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment thread server/events.go Outdated
Comment thread server/avl/seqset.go Outdated
Comment thread server/events.go Outdated
Comment thread server/events.go Outdated
Comment thread server/avl/seqset.go
Streams with many interior deletes was causing issues due to the fact that the interior deletes were represented as a sorted []uint64.
This approach introduces 3 sub types of delete blocks, avl bitmask tree, a run length encoding, and the legacy format above.
We also take into account large interior deletes such that on receiving a snapshot we can skip things we already know about.

Signed-off-by: Derek Collison <derek@nats.io>
@derekcollison derekcollison force-pushed the binary-stream-snapshot branch from f483cdc to 4d7cd26 Compare July 3, 2023 15:42
@derekcollison
Copy link
Copy Markdown
Member Author

I squashed the commits, good to merge?

@derekcollison derekcollison merged commit a393653 into dev Jul 5, 2023
@derekcollison derekcollison deleted the binary-stream-snapshot branch July 5, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants